refactor(db): remove function for periodic backup of RocksDB database#6724
Conversation
There was a problem hiding this comment.
[SHOULD] framework/build.gradle still references BackupDbUtilTest.class in two spots, but this PR deletes that test class:
- line 119:
t.exclude '**/BackupDbUtilTest.class'(Windows-exclude block) - line 164:
include 'org/tron/core/db/backup/BackupDbUtilTest.class'(in thetestWithRocksDbtask)
Gradle silently ignores include/exclude patterns that match nothing, so the build won't break — but they're dead config. Please remove them in this PR so the cleanup is complete.
Sunny6889
left a comment
There was a problem hiding this comment.
Operator notice (suggest adding to release notes)
Nodes upgrading from a version where storage.backup.enable = true will have leftover artifacts on disk:
- The
propPathfile configured by the user (default:prop.properties) - The
bak1path/bak2pathdirectories (defaults:bak1/database/andbak2/database/)
Please call this out explicitly in the release notes: operators should manually delete these paths after upgrading to reclaim disk space. Without this guidance, the dead backup directories will silently keep consuming storage on every node that previously had the feature enabled.
|
@Sunny6889 This feature stopped working a long time ago. It might be worth mentioning this in the release notes documentation. |
Remove it in |
What does this PR do?
Removes the periodic database backup feature (
storage.backup) entirely. This includes the backup configuration class, the AspectJ aspect that interceptedpushBlockto trigger copies, the backup utility, and all associated test fixtures and config files.Closes #6595.
Why are these changes required?
The
storage.backupfeature was designed to guard against data corruption from disk failures or abrupt process termination (e.g.kill -9). It has since become more harmful than helpful:kill -9does not corrupt RocksDB, which was the primary motivation for the feature.node.backup(UDP keep-alive failover). If one node becomes unavailable, traffic can be switched to the standby without any file-copy disruption.Changes:
DbBackupConfig,BackupDbUtil,BackupRocksDBAspect,NeedBeanCondition(common/framework).CommonParameter.dbBackupConfigfield andArgs.initRocksDbBackupProperty()initialiser.ConfigKey.STORAGE_BACKUP_*constants and the conditionalbackupRocksDBAspectSpring bean fromDefaultConfig.BackupDbUtilTestandconfig-test-dbbackup.conf; updatedRocksDbDataSourceImplTestandSupplementTestto useTEST_CONF.storage.backupblock is no longer read and has no effect. Nodes carrying this section in their config file can leave it in place without error, but it will be silently ignored.Backward Compatibility: Not compatible with v4.8.1 or older.
This PR has been tested by:
Follow up
Operators who currently rely on
storage.backupshould migrate to thenode.backupprimary–backup failover configuration.Extra details
N/A